<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>家长管理</title>
    <meta name="context-path" th:content="@{/}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/bootstrap.min.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/bootstrap-responsive.min.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/matrix-style.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/matrix-media.css}"/>
    <link rel="stylesheet" th:href="@{/resources/matrix/css/matrix-full.css}"/>
    <link rel="stylesheet" th:href="@{/resources/jquery-easyui/themes/metro/easyui.css}" />
    <link rel="stylesheet" th:href="@{/resources/matrix/font-awesome/css/font-awesome.css}"/>
    <link rel="stylesheet" th:href="@{/resources/layui/css/layui.css}" media="all">
    <link rel="stylesheet" th:href="@{/resources/css/website.css}"/>
</head>
<body class="childbody">
<div class="container-fluid">
    <!--Chart-box-->
    <div class="row-fluid">
        <div class="widget-box">
            <div class="widget-title bg_lg"><span class="icon"><i class="icon-search"></i></span>
                <h5>查询</h5>
            </div>
            <div class="widget-content nopadding">
                <form id="queryform" action="#" method="get" class="form-horizontal query-form">
                    <div class="row-fluid query-row">
                        <div class="span4">
                            <div class="control-group">
                                <label class="control-label query-control-label">用户名</label>
                                <div class="controls query-controls">
                                    <input type="text" id="userName" name="userName" class="span11" placeholder="请输入用户名">
                                </div>
                            </div>
                        </div>
                        <div class="span4">
                            <div class="control-group">
                                <label class="control-label query-control-label">真实姓名</label>
                                <div class="controls query-controls">
                                    <input type="text" id="realName" name="realName" class="span11" placeholder="请输入真实姓名">
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--<div class="row-fluid query-row">
                        <div class="span3">
                            <div class="control-group">
                                <label class="control-label">行政区划：</label>
                                <div class="controls form-group">
                                    <select class="span6 form-control" id="county" name="orgId">
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>-->
                    <div class="form-actions">
                        <button id="btnSearch" type="button" class="btn btn-primary">查询</button>
                        <button id="btnResetSearch" type="button" class="btn btn-info">重置</button>

                    </div>
                </form>
            </div>
        </div>
        <!--End-Chart-box-->
        <div class="row-fluid">
            <div class="span12">
                <div class="widget-box">
                    <div class="widget-title"><span class="icon"> <i class="icon-th"></i> </span>
                        <h5>数据</h5>
                    </div>
                    <div class="widget-content nopadding">
                        <div class="table_actions">
                            <button id="btnDetermine"  type="button"  class="btn btn-primary">确定</button>
                        </div>
                        <table id="tablelist" class="layui-table">
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script th:src="@{/resources/js/jquery.min.js}"></script>
<script th:src="@{/resources/js/jquery-migrate-1.2.1.js}"></script>
<script th:src="@{/resources/jquery-easyui/jquery.easyui.min.js}"></script>
<script th:src="@{/resources/layui/layui.all.js}" charset="utf-8"></script>
<script th:src="@{/resources/valid/js/bootstrapValidator.js}"></script>
<script th:src="@{/resources/valid/js/language/zh_CN.js}"></script>
<script th:src="@{/resources/js/website.js}"></script>
<script th:src="@{/resources/js/system.js}"></script>
<script th:src="@{/resources/js/validation_fields.js}"></script>
<script th:inline="javascript">
    /*<![CDATA[*/
    $(document).keyup(function (event) {
        if (event.keyCode == 13) {
            search();
        }
    });
    /*]]>*/
</script>

<script th:inline="javascript">
    /*<![CDATA[*/
    var query,determine;

    var List_determine = function (layer,edit) {
        var self = this;
        self.msg = "确认选择该家长吗？";
        self.submit = function () {
            var data = query.getChecked();
            if (data.length < 1) {
                layer.msg("您没有选中记录");
                return;
            }
            layer.confirm(self.msg, {
                btn: ['确认', '取消'],
                yes: function (index) {
                    try {
                        layer.load();
                        console.log(data);
                        edit.editCompleted(data);
                    }
                    catch (e) {
                        layer.closeAll('loading');
                    }
                }
            });
        }
    }

    layui.use(['jquery', 'layer', 'laydate'], function () {
        var $ = layui.jquery,
            layer = layui.layer,
            table = layui.table;

        lay('.date').each(function () {
            laydate.render({
                elem: this
            });
        });

        var cols = [
            [
                {type:'radio'},
                {field: 'userName', width: '20%', title: '用户名', sort: true},
                {field: 'realName', width: '20%', title: '真实姓名', sort: true},
                {field: 'phoneNumber', width: '15%', title: '手机号码', sort: true},
                {field: 'lastLoginTime', width: '15%', title: '最后登录时间', sort: true},
                {field: 'description', title: '描述', sort: true},
            ]
        ];

        query = new ListQuery(table, {
            cols: cols,
            element: "#tablelist",
            url: contextRoot + "schoolStudentParent/doListParent",
            page: 1,
            tableid: "user_list_table",
            extraData: function () {
                return $("#queryform").serializeObject();
            }
        })
        query.reload();

        $("#btnSearch").bind("click", function (event) {
            query.reload();
        });

        determine = new List_determine(layer, parent.view);

        $("#btnDetermine").bind("click", function (event) {
            determine.submit();
        });

    });

    /*]]>*/
</script>
</body>
</html>